#ifndef __PDTPCHolder_H_
#define __PDTPCHolder_H_

#include <iostream>

using namespace std;

class PDTPCHolder {
public:
    int pre;
    int post;

    PDTPCHolder() : 
        pre(-1), post(-1) {
    }

    PDTPCHolder(unsigned int aPre, unsigned int aPost):
        pre(aPre), post(aPost) {
    }

    virtual bool isPDTPCHolder() {
        return true;
    }

    virtual bool isPDTIfPCHolder() {
        return false;
    }

    virtual bool isPDTWhilePCHolder() {
        return false;
    }

    virtual stringstream & toString(stringstream & ss) const {
        ss << "----- PCHolder -----" << endl;
        ss << "--- pre = " << pre <<  endl;
        ss << "--- post = " << post << endl;
        ss << "----- -------- -----" << endl;
        return ss;
    }
};

class PDTIfPCHolder : public PDTPCHolder {
public:
    int begin_then;
    int end_then;
    int begin_else;
    int end_else;

    PDTIfPCHolder():
        PDTPCHolder() {
    }

    PDTIfPCHolder(unsigned int aPre, unsigned int aPost, unsigned int aBegin_then,
        unsigned int aEnd_then, unsigned int aBegin_else, unsigned int aEnd_else):
            PDTPCHolder(aPre, aPost), begin_then(aBegin_then), end_then(aEnd_then),
            begin_else(aBegin_else), end_else(aEnd_else) {
    }

    virtual bool isPDTIfPCHolder() {
        return true;
    }

    virtual stringstream & toString(stringstream & ss) const {
        ss << "----- If Statement -----" << endl;
        ss << "--- pre = " << pre << endl;
        ss << "--- begin_then = " << begin_then << endl;
        ss << "--- end_then = " << end_then << endl;
        ss << "--- begin_else = " << begin_else << endl;
        ss << "--- end_else = " << end_else << endl;
        ss << "--- post = " << post << endl;
        ss << "----- ----------- ------" << endl;
        return ss;
    }
    
};

class PDTWhilePCHolder : public PDTPCHolder {
public:
    int begin_while;
    int end_while;

    PDTWhilePCHolder():
        PDTPCHolder() {
    }

    PDTWhilePCHolder(unsigned int aPre, unsigned int aPost, 
        unsigned int aBegin_while, unsigned int aEnd_while):
            PDTPCHolder(aPre, aPost), begin_while(aBegin_while), 
            end_while(aEnd_while) {
    }

    virtual bool isPDTWhilePCHolder() {
        return true;
    }

    virtual stringstream & toString(stringstream & ss) const {
        ss << "----- While Statement -----" << endl;
        ss << "--- pre = " << pre << endl;
        ss << "--- begin_while = " << begin_while << endl;
        ss << "--- end_while = " << end_while << endl;
        ss << "--- post = " << post << endl;
        ss << "----- ----------- ------" << endl;
        return ss;
    }
};

#endif
